import { get, controller } from '../../decorators/router.metadata.decorator';

@controller({ prefix: '/namespaces' })
export class NamespaceController {

    @get({ url: '/' })
    async namespaces(ctx: any) {
        ctx.body = { code: '0', data: [{ name: ctx.query.name }] };
    }

    @get({ url: '/detail' })
    async namespacesDetail(ctx: any) {
        await ctx.render('index', {
            title: ctx.query.name,
            namespaces: ['eks-namespace', 'devops']
        });
    }
}